package com.content.scaffold.common.client.proxy;

import com.notarycloud.client.NotaryCloudClient;
import org.jetbrains.annotations.NotNull;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.support.DynamicMethodMatcherPointcut;

import java.lang.reflect.Method;

/**
 * @author xiaojl
 */
public class NotaryCloudClientPointCut extends DynamicMethodMatcherPointcut {
    @Override
    public boolean matches(Method method, @NotNull Class<?> aClass, @NotNull Object... objects) {
        return "newRequest".equals(method.getName());
    }

    @NotNull
    @Override
    public ClassFilter getClassFilter() {
        return cls -> cls == NotaryCloudClient.class;
    }

}
